<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%  
response.setHeader("Access-Control-Allow-Origin", "*");  
%> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="referrer" content="no-referrer" />
	<title>展会参展企业·数据工厂</title>
	<link href="${pageContext.request.contextPath }/img/webLogoIcon.png" rel="shortcut icon">
    <link href="${pageContext.request.contextPath }/css/bootstrap.min.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath }/css/font-awesome.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath }/css/animate.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath }/css/style.css" rel="stylesheet">
    <!-- FooTable -->
    <link href="${pageContext.request.contextPath }/css/footable.core.css" rel="stylesheet">
    <link href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.css" rel="stylesheet" />
    <link href="${pageContext.request.contextPath}/css/mypage.css" rel="stylesheet">
    <style>
		.select2_demo_1{
			float: left;
			width: 120px;
			display: inline;
			margin-left: 10px;
		}
		.form-control{
			display: inline;
		}
		
		.col-sm-3{
			float:right;
			width: 560px;
		}
		.input-group{
			float:right;
			width: 240px;
			margin-left: 5px;
		}
	   td{
	        vertical-align:middle;
	    }
	    .source{
	    	display:inline-block;
	        cursor: pointer;
		   	margin-bottom: 10px;
		    padding: 5px 5px;
		    border: 1px solid #ccc;
		    border-radius: 4px;
		    margin-right: 20px;
   		}
   		.sourceAct{
   			border-color:#f8ac59;
   			color:#f8ac59;
   		}
   		.webAct{
   			border-color:#f8ac59 !important;
   			color:#f8ac59;
   		}
   		.web{
	    	display:inline-block;
	        cursor: pointer;
		   	margin-bottom: 10px;
		    padding: 5px 5px;
		    border: 1px solid #ccc;
		    border-radius: 4px;
		    margin-right: 20px;
   		}
	</style>
</head>
<body>
    <div id="wrapper">
        <nav class="navbar-default navbar-static-side" role="navigation">
            <%request.setAttribute("LEFT", "exhibitionCompany");%>
            <%@include file="../components/left.jsp"%>
        </nav>
        <div id="page-wrapper" class="gray-bg">
        <div class="row border-bottom">
		<jsp:include page="../components/head.jsp" flush="true" />
        </div>
        <div class="row wrapper border-bottom white-bg page-heading">
            <div class="col-lg-9">
                <h2>展会企业详情</h2>
                <ol class="breadcrumb">
                	<li class="nav-main1">
                		<a href="${pageContext.request.contextPath}/admin/tosystem_overview">主页</a>
                	</li>
                	<li class="nav-main2" >
                		<a id="navigation1" href="#" >企业数据</a>
                	</li>
                	<li class="active">
                		<a>展会参展企业</a>
                	</li>
                	<li class="active">
                		<a>展会企业详情</a>
                	</li>
               	</ol>
            </div>
        </div>
        <div class="wrapper wrapper-content animated fadeInRight">
            <div class="row">
                <div class="col-lg-12">
                    <div class="ibox float-e-margins">
                        <div class="ibox-content">
                            <div class="row m-t-sm">
                                <div class="col-lg-12">
                                <div class="panel blank-panel">
                                <div class="panel-body">
                                <div class="tab-content">
                                <div class="tab-pane active" id="tab-1">
                                	<p id="company_name" style="margin-left:13px;color: black;font-size: 20px;font-family: cursive;"></p>
                                	<div id="jianjie">
                                    </div>
<!--                                     <br> -->
<!--                                     <div class="feed-activity-list"> -->
<!--                                     	<table class="table table-bordered"> -->
<!--                                     		<thead> -->
<!-- 	                                    		<tr> -->
<!-- 	                                    			<th>图标</th> -->
<!-- 	                                    			<th>受资方</th> -->
<!-- 	                                    			<th>时间</th> -->
<!-- 	                                    			<th>轮次</th> -->
<!-- 	                                    			<th>金额</th> -->
<!-- <!-- 	                                    			<th>投资方</th> -->
<!-- 	                                    			<th>采集时间</th> -->
<!-- 											  	</tr> -->
<!--                                     		</thead> -->
<!--                                     		<tbody id="list"> -->
                                    			
<!--                                     		</tbody> -->
<!-- 										</table> -->
<!--                                     </div> -->
<!--                                     <br> -->
<!--                                     <div class="feed-activity-list"> -->
<!--                                     	<h3>融资历史</h3> -->
<!--                                     	<table class="table table-bordered"> -->
<!--                                     		<thead> -->
<!-- 	                                    		<tr> -->
<!-- 	                                    			<th>序号</th> -->
<!-- 	                                    			<th>轮次</th> -->
<!-- 	                                    			<th>投资方</th> -->
<!-- 	                                    			<th>时间</th> -->
<!-- 	                                    			<th>金额</th> -->
<!-- 											  	</tr> -->
<!--                                     		</thead> -->
<!--                                     		<tbody id="list2"> -->
                                    			
<!--                                     		</tbody> -->
<!-- 										</table> -->
<!--                                     </div> -->
                                    
                                </div>
                                </div>
                                </div>
                                </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
        </div>
        </div>
		<jsp:include page="../components/footer.jsp" flush="true" />
        </div>
        </div>
    <!-- Mainly scripts -->
    <script src="${pageContext.request.contextPath }/js/jquery-2.1.1.js"></script>
    <script src="${pageContext.request.contextPath }/js/bootstrap.min.js"></script>
    <script src="${pageContext.request.contextPath }/js/jquery.metisMenu.js"></script>
    <script src="${pageContext.request.contextPath }/js/jquery.slimscroll.min.js"></script>
    <!-- Custom and plugin javascript -->
    <script src="${pageContext.request.contextPath }/js/inspinia.js"></script>
    <script src="${pageContext.request.contextPath }/js/pace.min.js"></script>
    <!-- FooTable -->
    <script src="${pageContext.request.contextPath }/js/footable.all.min.js"></script>
	<script src="${pageContext.request.contextPath}/js/mypage.js"></script>
    <!-- Page-Level Scripts -->
    <script>
        $(document).ready(function() {
            $('.footable').footable();
        });
	     
        var article_public_id = '${article_public_id}';
        console.log("article_public_id:"+article_public_id)
        
        $(function(){
        	carlist()
		});
        
		function carlist(){
        	$.ajax({
        		url : "${pageContext.request.contextPath}/investmentFinancing/exhibitionCompany-detail",
        		type : "post",
        		data:{
        			article_public_id: article_public_id
        		},
        		success: function(res) {
        			res = JSON.parse(res);
        			console.log(res.basic_information)
        			
        			$('#company_name').html(res.company_name)
        			if(res.basic_information!=undefined && res.basic_information.trim()!=''){
	        			let basic_information=JSON.parse(res.basic_information)
	        			for(let key in basic_information){
	        				if(key=='经营范围' || key=='企业简介'){
	        					$("#jianjie").append(
	        						'<p class="col-lg-12">'+key+'： '+basic_information[key]+'</p>'
	        					);
	        				}else{
	        					$("#jianjie").append(
	                  				'<span class="col-lg-4">'+key+'： '+basic_information[key]+'</span>'
	                   			);
	        				}
	        			}
        			}
        			if(res.business_card!=undefined && res.business_card.trim()!=''){
        				let business_card=JSON.parse(res.business_card)
        				$('#tab-1').append(
                                '<div class="col-lg-12 feed-activity-list">'+
                                 	'<h3>展位名片</h3>'+
                                 	'<table class="table table-bordered">'+
                                 		'<thead>'+
                                      		'<tr>'+
                                      			'<th>邮箱</th>'+
                                      			'<th>手机</th>'+
                                      			'<th>姓名</th>'+
                                      			'<th>座机</th>'+
                                      			'<th>职位</th>'+
   									  		'</tr>'+
                                 		'</thead>'+
                                 		'<tbody id="business_card">'+
                                 		'</tbody>'+
   									 '</table>'+
                                 '</div>'
                        )
        				for(let o of business_card){
        					$('#business_card').append(
        						'<tr>'+
	                                '<td>'+(o.邮箱==undefined ? "" : o.邮箱.trim())+'</td>'+
	                                '<td>'+(o.手机==undefined ? "" : o.手机.trim())+'</td>'+
	                                '<td>'+(o.name==undefined ? "" : o.name.trim())+'</td>'+
	                                '<td>'+(o.座机==undefined ? "" : o.座机.trim())+'</td>'+
	                                '<td>'+(o.zw==undefined ? "" : o.zw.trim())+'</td>'+
	                            '</tr>'
           					)
        				}
        			}
        			if(res.contact!=undefined && res.contact.trim()!=''){
        				let contact=JSON.parse(res.contact)
        				$('#tab-1').append(
                                '<div class="col-lg-12 feed-activity-list">'+
                                 	'<h3>挖掘联系人</h3>'+
                                 	'<table class="table table-bordered">'+
                                 		'<thead>'+
                                      		'<tr>'+
                                      			'<th>座机</th>'+
                                      			'<th>手机</th>'+
                                      			'<th>来源</th>'+
                                      			'<th>邮箱</th>'+
   									  		'</tr>'+
                                 		'</thead>'+
                                 		'<tbody id="contact">'+
                                 		'</tbody>'+
   									 '</table>'+
                                 '</div>'
                        )
        				for(let o of contact){
        					$('#contact').append(
        						'<tr>'+
	                                '<td>'+(o.tel==undefined ? "" : o.tel.trim())+'</td>'+
	                                '<td>'+(o.telephone==undefined ? "" : o.telephone.trim())+'</td>'+
	                                '<td>'+(o.source==undefined ? "" : o.source.trim())+'</td>'+
	                                '<td>'+(o.email==undefined ? "" : o.email.trim())+'</td>'+
	                            '</tr>'
           					)
        				}
        			}
        			if(res.main_staff!=undefined && res.main_staff.trim()!=''){
        				let main_staff=JSON.parse(res.main_staff)
        				let i=1
        				$('#tab-1').append(
                                '<div class="col-lg-12 feed-activity-list">'+
                                 	'<h3>主要人员</h3>'+
                                 	'<table class="table table-bordered">'+
                                 		'<thead>'+
                                      		'<tr>'+
                                      			'<th>序号</th>'+
                                      			'<th>姓名</th>'+
                                      			'<th>职位</th>'+
   									  		'</tr>'+
                                 		'</thead>'+
                                 		'<tbody id="main_staff">'+
                                 		'</tbody>'+
   									 '</table>'+
                                 '</div>'
                        )
        				for(let o of main_staff){
        					$('#main_staff').append(
        						'<tr>'+
	                                '<td>'+i+'</td>'+
	                                '<td>'+(o.name==undefined ? "" : o.name.trim())+'</td>'+
	                                '<td>'+(o.zw==undefined ? "" : o.zw.trim())+'</td>'+
	                            '</tr>'
           					)
           					i++
        				}
        			}
        			if(res.shareholders!=undefined && res.shareholders.trim()!=''){
        				let shareholders=JSON.parse(res.shareholders)
        				$('#tab-1').append(
                                '<div class="col-lg-12 feed-activity-list">'+
                                 	'<h3>股东</h3>'+
                                 	'<table class="table table-bordered">'+
                                 		'<thead>'+
                                      		'<tr>'+
                                      			'<th>姓名</th>'+
                                      			'<th>认缴出资日期</th>'+
                                      			'<th>持股比例</th>'+
                                      			'<th>认缴出资额(万元)</th>'+
   									  		'</tr>'+
                                 		'</thead>'+
                                 		'<tbody id="shareholders">'+
                                 		'</tbody>'+
   									 '</table>'+
                                 '</div>'
                        )
        				for(let o of shareholders){
        					$('#shareholders').append(
        						'<tr>'+
	                                '<td>'+(o.姓名==undefined ? "" : o.姓名.trim())+'</td>'+
	                                '<td>'+(o.认缴出资日期==undefined ? "" : o.认缴出资日期.trim())+'</td>'+
	                                '<td>'+(o.持股比例==undefined ? "" : o.持股比例.trim())+'</td>'+
	                                '<td>'+(o["认缴出资额(万元)"]==undefined ? "" : o["认缴出资额(万元)"].trim())+'</td>'+
	                            '</tr>'
           					)
        				}
        			}
        			if(res.exhibition_record!=undefined && res.exhibition_record.trim()!=''){
        				let exhibition_record=JSON.parse(res.exhibition_record)
        				$('#tab-1').append(
                                '<div class="col-lg-12 feed-activity-list">'+
                                 	'<h3>参展记录</h3>'+
                                 	'<table class="table table-bordered">'+
                                 		'<thead>'+
                                      		'<tr>'+
                                      			'<th>时间</th>'+
                                      			'<th>logo</th>'+
                                      			'<th>标签</th>'+
                                      			'<th>展位号</th>'+
                                      			'<th>展会</th>'+
                                      			'<th>其它信息</th>'+
   									  		'</tr>'+
                                 		'</thead>'+
                                 		'<tbody id="exhibition_record">'+
                                 		'</tbody>'+
   									 '</table>'+
                                 '</div>'
                        )
        				for(let o of exhibition_record){
        					$('#exhibition_record').append(
        						'<tr>'+
	                                '<td>'+(o.时间==undefined ? "" : o.时间.trim())+'</td>'+
	                                '<td>'+(o.logo==undefined || o.logo.trim()=="" ? "暂无" : "<img style=\"width:50px;height:50px;\" src=\""+o.logo.trim()+"\">")+'</td>'+
	                                '<td>'+(o.标签==undefined ? "" : o.标签.trim())+'</td>'+
	                                '<td>'+(o.展位号==undefined ? "" : o.展位号.trim())+'</td>'+
	                                '<td>'+(o.展会==undefined ? "" : o.展会.trim())+'</td>'+
	                                '<td>'+(o.other==undefined ? "" : o.other.trim())+'</td>'+
	                            '</tr>'
           					)
        				}
        			}
        			if(res.registered_exhibition!=undefined && res.registered_exhibition.trim()!=''){
        				let registered_exhibition=JSON.parse(res.registered_exhibition)
        				$('#tab-1').append(
                                '<div class="col-lg-12 feed-activity-list">'+
                                 	'<h3>已报名展会</h3>'+
                                 	'<table class="table table-bordered">'+
                                 		'<thead>'+
                                      		'<tr>'+
                                      			'<th>时间</th>'+
                                      			'<th>logo</th>'+
                                      			'<th>标签</th>'+
                                      			'<th>展位号</th>'+
                                      			'<th>展会</th>'+
                                      			'<th>其它信息</th>'+
   									  		'</tr>'+
                                 		'</thead>'+
                                 		'<tbody id="registered_exhibition">'+
                                 		'</tbody>'+
   									 '</table>'+
                                 '</div>'
                        )
        				for(let o of registered_exhibition){
        					$('#registered_exhibition').append(
        						'<tr>'+
	                                '<td>'+(o.时间==undefined ? "" : o.时间.trim())+'</td>'+
	                                '<td>'+(o.logo==undefined || o.logo.trim()=="" ? "暂无" : "<img style=\"width:50px;height:50px;\" src=\""+o.logo.trim()+"\">")+'</td>'+
	                                '<td>'+(o.标签==undefined ? "" : o.标签.trim())+'</td>'+
	                                '<td>'+(o.展位号==undefined ? "" : o.展位号.trim())+'</td>'+
	                                '<td>'+(o.展会==undefined ? "" : o.展会.trim())+'</td>'+
	                                '<td>'+(o.other==undefined ? "" : o.other.trim())+'</td>'+
	                            '</tr>'
           					)
        				}
        			}
        			if(res.photo!=undefined && res.photo.trim()!=''){
        				let photo=JSON.parse(res.photo)
        				$('#tab-1').append(
                                '<div class="col-lg-12 feed-activity-list" id="photo">'+
                                 	'<h3>参展照片</h3>'+
                                '</div>'
                        )
        				for(let o of photo){
        					if(o.src==undefined || o.src.trim()==''){
        						continue
        					}
        					$('#photo').append(
        						'<p>描述信息：'+(o.abstract==undefined ? "" : o.abstract.trim())+'</p>'+
        						'<p><img src="'+o.src.trim()+'"></p>'
           					)
        				}
        			}
        		},
        		error: function(err) {
        			console.log(err)
        		}
        	});
        }
    </script>
	<script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.js"></script>
</body>
</html>
